import { App } from 'vue';
import { withInstall } from '@ibiz-template/vue3-util';
import { registerEditorProvider } from '@ibiz-template/runtime';
import { OdooStatusBar } from './odoo-status-bar';
import { OdooStatusBarEditorProvider } from './odoo-status-bar-editor.provider';

export const IBizOdooStatusBar = withInstall(OdooStatusBar, v => {
  v.component(OdooStatusBar.name!, OdooStatusBar);
  registerEditorProvider(
    'EDITOR_CUSTOMSTYLE_ODOO_STATUS_BAR',
    () => new OdooStatusBarEditorProvider(),
  );
});

export default {
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
  install(app: App) {
    app.use(IBizOdooStatusBar);
  },
};
